﻿#ifndef CRASHSUPER_H
#define CRASHSUPER_H


class crashSuper
{
public:
    virtual double acceptCrash(double money) = 0;
};

#endif // CRASHSUPER_H

class crashNormal : public crashSuper
{
public:
    virtual double acceptCrash(double money) override;
};

class crashRebate : public crashSuper
{
public:
    crashRebate(double rebate);
    virtual double acceptCrash(double money) override;

private:
    double moneyRebate = 0.8;
};

class CrashReturn : public crashSuper
{
public:
    CrashReturn(double condition, double ret);
    virtual double acceptCrash(double money) override;
private:
    double moneyCondition = 300;
    double moneyReturn = 100;
};

class cashContext
{
public:
    cashContext(int i) : index(i) {}

    double getResult(double money);

private:
    int index;
};
